package com.fesine.ssh.model;

import javax.persistence.*;
import java.util.Date;

/**
 * 产品类
 *
 * @author fesine
 */
@Entity
@Table(name = "t_product")
public class Product extends BasePo{
    /**
     * 产品编号
     */
    private String prodId;
    /**
     * 产品名称
     */
    private String name;
    /**
     * 产品描述
     */
    private String descr;
    /**
     * 市场价
     */
    private double normaPrice;
    /**
     * 会员价
     */
    private double memberPrice;
    /**
     * 上货日期
     */
    private Date pdate;
    /**
     * 所属类别(多对一的关系)
     */
    private Category category;
    /**
     * 照片
     */
    private String photo;

    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public String getProdId() {
        return prodId;
    }

    public void setProdId(String prodId) {
        this.prodId = prodId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescr() {
        return descr;
    }

    public void setDescr(String descr) {
        this.descr = descr;
    }

    public double getNormaPrice() {
        return normaPrice;
    }

    public void setNormaPrice(double normaPrice) {
        this.normaPrice = normaPrice;
    }

    public double getMemberPrice() {
        return memberPrice;
    }

    public void setMemberPrice(double memberPrice) {
        this.memberPrice = memberPrice;
    }

    public Date getPdate() {
        return pdate;
    }

    public void setPdate(Date pdate) {
        this.pdate = pdate;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "cateId",referencedColumnName = "cateId",nullable = false)
    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }


}
